package com.itheima.demo.Demo06;

public class NiMing {
    public static void main(String[] args) {
        new Thread(){
            @Override
            public void run() {
                for (int i = 0; i <=20 ; i++) {
                    System.out.println(Thread.currentThread().getName()+" "+i);
                    try {
                        Thread.sleep(500);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }.start();
        ////////////////////////////////////////////////////////////
     new Thread(
             new Runable(){
                 @Override
                 public void run() {    for (int i = 0; i <=20 ; i++) {
                     System.out.println(Thread.currentThread().getName()+" "+i);
                     try {
                         Thread.sleep(500);
                     } catch (InterruptedException e) {
                         e.printStackTrace();
                     }
                 }

                 }
             }
     ).start();



    }







    }

